package com.xinqi.modules.user.user.dto.req;

import com.xinqi.common.core.constant.UserConstants;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

/**
 * 密码修改
 *
 * @version V1.0
 * @Title:
 * @ClassName: com.xinqi.modules.sys.user.user.dto.req.PasswordChangeDto.java
 * @Description:
 * @Copyright 星齐科技（云南）有限公司 - Powered By 技术部
 * @author: yyzhen
 * @date: 2023/3/8 11:15
 */
@Data
public class PasswordChangeDto {

    /**
     * 旧密码
     */
    @NotBlank(message = "{sys.user.password.old.not.blank}")
    @Length(min = UserConstants.PASSWORD_MIN_LENGTH, max = UserConstants.PASSWORD_MAX_LENGTH, message = "{user.password.length.valid}")
    private String oldPassword;

    /**
     * 新密码
     */
    @NotBlank(message = "{sys.user.password.new.not.blank}")
    @Length(min = UserConstants.PASSWORD_MIN_LENGTH, max = UserConstants.PASSWORD_MAX_LENGTH, message = "{user.password.length.valid}")
    private String newPassword;

    /**
     * 确认密码
     */
    @NotBlank(message = "{sys.user.password.confirm.not.blank}")
    @Length(min = UserConstants.PASSWORD_MIN_LENGTH, max = UserConstants.PASSWORD_MAX_LENGTH, message = "{user.password.length.valid}")
    private String confirmPassword;

    @Schema(title = "用户ID(内部流转参数，不对外)", hidden = true)
    private Long userId;
}
